import * as api from './util';


export function getHomeData() {
  return api.get('/applets/provider/homeData/get');
}

export function getShareData(companyId) {
  let postbody = { companyId: companyId };
  return api.get('/applets/provider/shareData/get', postbody);
}

export function getTradeData(companyId) {
  let postbody = { companyId: companyId };
  return api.get('/applets/provider/tradingData/get', postbody);
}

export function getMyCompanies() {
  let postbody = { pageNo: 1, pageSize: 999 }
  return api.get('/applets/provider/userCompany/getMyCompanys', postbody);
}

export function switchCompany(companyId) {
  let postbody = { companyId: companyId };
  return api.get('/applets/provider/userCompany/switchMyCompany', postbody);
}

export function updateSwitchInfo() {
  return api.get('/applets/provider/customUser/info');
}

export function getPromptMsgs() {
  return api.post('/applets/provider/message/promptArea');
}

export function getMsgs(pageNo, pageSize) {
  let postbody = { pageNo, pageSize };
  return api.post('/applets/provider/message/list', postbody);
}

export function getUnReadMsg() {
  return api.get('/applets/provider/message/countMsg');
}

export function markAsRead() {
  return api.post('/applets/provider/message/allSignAsRead');
}

export function markAsReadOne(postbody) {
  return api.post('/applets/message/sign', postbody);
}

export function delMsg(postbody) {
  return api.get('/applets/delMsg', postbody);
}

// 交易数据统计
export function getTradingDataSta(recentDay) {
  return api.get('/applets/provider/tradingData/get', { recentDay: recentDay });
}

// 分享数据统计
export function getShareDataSta(recentDay) {
  return api.get('/applets/provider/shareData/get', { recentDay: recentDay });
}